home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / Dev / Oberon / source / amiga / Rexx.mod < prev    next >
Text File  |  1995-06-29  |  24KB  |  575 lines

  1. (**************************************************************************
  2.  
  3.      $RCSfile: Rexx.mod $
  4.   Description: Interface to ARexx
  5.  
  6.    Created by: fjc (Frank Copeland)
  7.     $Revision: 3.8 $
  8.       $Author: fjc $
  9.         $Date: 1995/06/04 23:13:14 $
  10.  
  11.   Includes Release 40.15
  12.  
  13.   (C) Copyright 1987,1988,1989,1990 William S. Hawes
  14.   (C) Copyright 1990-1993 Commodore-Amiga, Inc.
  15.       All Rights Reserved
  16.  
  17.   Oberon-A interface Copyright © 1994-1995, Frank Copeland.
  18.   This file is part of the Oberon-A Interface.
  19.   See Oberon-A.doc for conditions of use and distribution.
  20.  
  21. ***************************************************************************)
  22.  
  23. <* STANDARD- *>
  24.  
  25. MODULE [2] Rexx;
  26.  
  27. IMPORT SYS := SYSTEM, e := Exec, d := Dos, s := Sets;
  28.  
  29.  
  30. (*
  31. **      $VER: storage.h 1.4 (8.11.91)
  32. **
  33. **      Header file to define ARexx data structures.
  34. *)
  35.  
  36.  
  37. (* The NexxStr structure is used to maintain the internal strings in REXX.
  38.  * It includes the buffer area for the string and associated attributes.
  39.  * This is actually a variable-length structure; it is allocated for a
  40.  * specific length string, and the length is never modified thereafter
  41.  * (since it's used for recycling).
  42.  *)
  43.  
  44. TYPE
  45.  
  46.   NexxStrPtr * = POINTER TO NexxStr;
  47.   NexxStr * = RECORD
  48.     ivalue * : LONGINT;                (* integer value                 *)
  49.     length * : e.UWORD;                (* length in bytes (excl null)   *)
  50.     flags *  : s.SET8;                 (* attribute flags               *)
  51.     hash *   : SHORTINT;               (* hash code                     *)
  52.     buff *   : ARRAY 8 OF CHAR;        (* buffer area for strings       *)
  53.   END; (* NexxStr *)                   (* size: 16 bytes (minimum)      *)
  54.  
  55. CONST
  56.  
  57.   nxAddLen * = 9;                     (* offset plus null byte *)
  58.  
  59. (* String attribute flag bit definitions                                *)
  60.   keep     * = 0;                 (* permanent string?             *)
  61.   string   * = 1;                 (* string form valid?            *)
  62.   notNum   * = 2;                 (* non-numeric?                  *)
  63.   number   * = 3;                 (* a valid number?               *)
  64.   binary   * = 4;                 (* integer value saved?          *)
  65.   float    * = 5;                 (* floating point format?        *)
  66.   ext      * = 6;                 (* an external string?           *)
  67.   source   * = 7;                 (* part of the program source?   *)
  68.  
  69. (* Combinations of flags                                                *)
  70.   intNum   * = { number, binary, string };
  71.   dpNum    * = { number, float };
  72.   alpha    * = { notNum, string };
  73.   owned    * = { source, ext, keep };
  74.   keepStr  * = { string, source, notNum };
  75.   keepNum  * = { string, source, number, binary };
  76.  
  77. (* The RexxArg structure is identical to the NexxStr structure, but
  78.  * is allocated from system memory rather than from internal storage.
  79.  * This structure is used for passing arguments to external programs.
  80.  * It is usually passed as an "argstring", a pointer to the string buffer.
  81.  *)
  82.  
  83. TYPE
  84.  
  85.   RexxArgPtr * = POINTER TO RexxArg;
  86.   RexxArg * = RECORD
  87.     size *   : LONGINT;                (* total allocated length        *)
  88.     length * : e.UWORD;                (* length of string              *)
  89.     flags *  : s.SET8;                 (* attribute flags               *)
  90.     hash *   : SHORTINT;               (* hash code                     *)
  91.     buff *   : ARRAY 8 OF CHAR;        (* buffer area                   *)
  92.   END; (* RexxArg *)                   (* size: 16 bytes (minimum)      *)
  93.  
  94. (* The RexxMsg structure is used for all communications with REXX
  95.  * programs.  It is an EXEC message with a parameter block appended.
  96.  *)
  97.  
  98. TYPE
  99.  
  100.   RexxMsgBase *= RECORD (e.MessageBase) END;
  101.   RexxMsgBasePtr *= POINTER TO RexxMsgBase;
  102.  
  103.   RexxMsgPtr * = POINTER TO RexxMsg;
  104.   RexxMsg * = RECORD (RexxMsgBase)
  105.     node *      : e.Message;            (* EXEC message structure        *)
  106.     taskBlock   : e.APTR;               (* global structure (private)    *)
  107.     libBase     : e.LibraryPtr;         (* library base (private)        *)
  108.     action *    : LONGINT;              (* command (action) code         *)
  109.     result1 *   : e.APTR;               (* primary result (return code)  *)
  110.     result2 *   : e.APTR;               (* secondary result              *)
  111.     args *      : ARRAY 16 OF e.LSTRPTR; (* argument block (ARG0-ARG15)   *)
  112.     passPort *  : e.MsgPortPtr;         (* forwarding port               *)
  113.     commAddr *  : e.LSTRPTR;             (* host address (port name)      *)
  114.     fileExt *   : e.LSTRPTR;             (* file extension                *)
  115.     stdin *     : d.FileHandlePtr;      (* input stream (filehandle)     *)
  116.     stdout *    : d.FileHandlePtr;      (* output stream (filehandle)    *)
  117.     avail *     : LONGINT;              (* future expansion              *)
  118.   END; (* RexxMsg *)                   (* size: 128 bytes               *)
  119.  
  120. CONST
  121.  
  122.   maxRMArg  * = 15;                   (* maximum arguments             *)
  123.  
  124. (* Command (action) codes for message packets                           *)
  125.   rxComm    * = 01000000H;           (* a command-level invocation    *)
  126.   rxFunc    * = 02000000H;           (* a function call               *)
  127.   rxClose   * = 03000000H;           (* close the REXX server *)
  128.   rxQuery   * = 04000000H;           (* query for information *)
  129.   rxAddFH   * = 07000000H;           (* add a function host           *)
  130.   rxAddLib  * = 08000000H;           (* add a function library        *)
  131.   rxRemLib  * = 09000000H;           (* remove a function library     *)
  132.   rxAddCon  * = 0A000000H;           (* add/update a ClipList string  *)
  133.   rxRemCon  * = 0B000000H;           (* remove a ClipList string      *)
  134.   rxTCOpn   * = 0C000000H;           (* open the trace console        *)
  135.   rxTCCls   * = 0D000000H;           (* close the trace console       *)
  136.  
  137. (* Command modifier flag bits                                           *)
  138.   rxNoIO    * = 00010000H;        (* suppress I/O inheritance?     *)
  139.   rxResult  * = 00020000H;        (* result string expected?       *)
  140.   rxString  * = 00040000H;        (* program is a "string file"?   *)
  141.   rxToken   * = 00080000H;        (* tokenize the command line?    *)
  142.   rxNonRet  * = 00100000H;        (* a "no-return" message?        *)
  143.  
  144.   rxfNoIO    * = 16;                (* suppress I/O inheritance?     *)
  145.   rxfResult  * = 17;                (* result string expected?       *)
  146.   rxfString  * = 18;                (* program is a "string file"?   *)
  147.   rxfToken   * = 19;                (* tokenize the command line?    *)
  148.   rxfNonRet  * = 20;                (* a "no-return" message?        *)
  149.  
  150.   rxCodeMask   * = 0FF000000H;
  151.   rxArgMask    * = 0000000FH;
  152.  
  153. (* The RexxRsrc structure is used to manage global resources.  Each node
  154.  * has a name string created as a RexxArg structure, and the total size
  155.  * of the node is saved in the "rrSize" field.  The REXX systems library
  156.  * provides functions to allocate and release resource nodes.  If special
  157.  * deletion operations are required, an offset and base can be provided in
  158.  * "rrFunc" and "rrBase", respectively.  This "autodelete" function will
  159.  * be called with the base in register A6 and the node in A0.
  160.  *)
  161.  
  162. TYPE
  163.  
  164.   RexxRsrcBase *= RECORD (e.NodeBase) END;
  165.   RexxRsrcBasePtr *= POINTER TO RexxRsrcBase;
  166.  
  167.   RexxRsrcPtr * = POINTER TO RexxRsrc;
  168.   RexxRsrc * = RECORD (RexxRsrcBase)
  169.     node * : e.Node;
  170.     func * : INTEGER;                 (* "auto-delete" offset          *)
  171.     base * : e.APTR;                  (* "auto-delete" base            *)
  172.     size * : LONGINT;                 (* total size of node            *)
  173.     arg1 * : e.APTR;                  (* available ...         *)
  174.     arg2 * : e.APTR;                  (* available ...         *)
  175.   END; (* RexxRsrc *)                 (* size: 32 bytes                *)
  176.  
  177. CONST
  178.  
  179. (* Resource node types                                                  *)
  180.   any      * = 0;                 (* any node type ...             *)
  181.   lib      * = 1;                 (* a function library            *)
  182.   port     * = 2;                 (* a public port         *)
  183.   file     * = 3;                 (* a file IoBuff         *)
  184.   host     * = 4;                 (* a function host               *)
  185.   clip     * = 5;                 (* a Clip List node              *)
  186.  
  187. (* The RexxTask structure holds the fields used by REXX to communicate with
  188.  * external processes, including the client task.  It includes the global
  189.  * data structure (and the base environment).  The structure is passed to
  190.  * the newly-created task in its "wake-up" message.
  191.  *)
  192.  
  193. CONST
  194.  
  195.   globalSz  * = 200;                  (* total size of GlobalData      *)
  196.  
  197. TYPE
  198.  
  199.   RexxTaskPtr * = POINTER TO RexxTask;
  200.   RexxTask * = RECORD
  201.     global *   : ARRAY globalSz OF e.BYTE; (* global data structure *)
  202.     msgPort *  : e.MsgPort;            (* global message port           *)
  203.     flags *    : s.SET8;               (* task flag bits                *)
  204.     sigBit *   : SHORTINT;             (* signal bit                    *)
  205.  
  206.     clientID * : e.APTR;               (* the client's task ID          *)
  207.     msgPkt *   : e.APTR;               (* the packet being processed    *)
  208.     taskID *   : e.APTR;               (* our task ID                   *)
  209.     rexxPort * : e.APTR;               (* the REXX public port          *)
  210.  
  211.     errTrap *  : e.APTR;               (* Error trap address            *)
  212.     stackPtr * : e.APTR;               (* stack pointer for traps       *)
  213.  
  214.     header1 *  : e.List;               (* Environment list              *)
  215.     header2 *  : e.List;               (* Memory freelist               *)
  216.     header3 *  : e.List;               (* Memory allocation list        *)
  217.     header4 *  : e.List;               (* Files list                    *)
  218.     header5 *  : e.List;               (* Message Ports List            *)
  219.   END; (* RexxTask *)
  220.  
  221. CONST
  222.  
  223. (* Definitions for RexxTask flag bits                                   *)
  224.   trace   * = 0;                 (* external trace flag           *)
  225.   halt    * = 1;                 (* external halt flag            *)
  226.   susp    * = 2;                 (* suspend task?         *)
  227.   tCUse   * = 3;                 (* trace console in use? *)
  228.   wait    * = 6;                 (* waiting for reply?            *)
  229.   close   * = 7;                 (* task completed?               *)
  230.  
  231. (* Definitions for memory allocation constants                          *)
  232.   memQuant  * = 16;                  (* quantum of memory space       *)
  233.   memMask   * = 0FFFFFFF0H;           (* mask for rounding the size    *)
  234.  
  235.   memQuick  * = {0};           (* EXEC flags: public       *)
  236.   memClear  * = {16};          (* EXEC flags: memClear        *)
  237.  
  238. (* The SrcNode is a temporary structure used to hold values destined for
  239.  * a segment array.  It is also used to maintain the memory freelist.
  240.  *)
  241.  
  242. TYPE
  243.  
  244.   SrcNodePtr * = POINTER TO SrcNode;
  245.   SrcNode * = RECORD
  246.     succ * : SrcNodePtr;            (* next node                     *)
  247.     pred * : SrcNodePtr;            (* previous node                 *)
  248.     ptr *  : e.APTR;                (* pointer value                 *)
  249.     size * : LONGINT;               (* size of object                *)
  250.   END; (* SrcNode *)                (* size: 16 bytes                *)
  251.  
  252.  
  253. (*
  254. **      $VER: rexxio.h 1.4 (8.11.91)
  255. **
  256. **      Header file for ARexx Input/Output related structures
  257. *)
  258.  
  259.  
  260. CONST
  261.  
  262.   rxBuffSz  * = 204;                  (* buffer length         *)
  263.  
  264. (*
  265.  * The IoBuff is a resource node used to maintain the File List.  Nodes
  266.  * are allocated and linked into the list whenever a file is opened.
  267.  *)
  268.  
  269. TYPE
  270.  
  271.   IoBuffPtr * = POINTER TO IoBuff;
  272.   IoBuff * = RECORD (RexxRsrcBase)
  273.     node * : RexxRsrc;                   (* structure for files/strings   *)
  274.     rpt *  : e.APTR;                     (* read/write pointer            *)
  275.     rct *  : LONGINT;                    (* character count               *)
  276.     dFH *  : d.FileHandlePtr;            (* DOS filehandle                *)
  277.     lock * : d.FileLockPtr;              (* DOS lock                      *)
  278.     bct *  : LONGINT;                    (* buffer length                 *)
  279.     area * : ARRAY rxBuffSz OF SYS.BYTE; (* buffer area                   *)
  280.   END; (* IoBuff *)                      (* size: 256 bytes               *)
  281.  
  282. CONST
  283.  
  284. (* Access mode definitions                                              *)
  285.   ioExist   * = -1;                (* an external filehandle        *)
  286.   ioStrF    * = 0;                 (* a "string file"               *)
  287.   ioRead    * = 1;                 (* read-only access              *)
  288.   ioWrite   * = 2;                 (* write mode                    *)
  289.   ioAppend  * = 3;                 (* append mode (existing file)   *)
  290.  
  291. (*
  292.  * Offset anchors for SeekF()
  293.  *)
  294.   ioBegin   * = -1;               (* relative to start             *)
  295.   ioCurr    * = 0;        (* relative to current position  *)
  296.   ioEnd     * = 1;        (* relative to end               *)
  297.  
  298. (* The Library List contains just plain resource nodes.         *)
  299.  
  300. (*
  301.  * The RexxClipNode structure is used to maintain the Clip List.  The value
  302.  * string is stored as an argstring in the rrArg1 field.
  303.  *)
  304.  
  305. (*
  306.  * A message port structure, maintained as a resource node.  The ReplyList
  307.  * holds packets that have been received but haven't been replied.
  308.  *)
  309.  
  310. TYPE
  311.  
  312.   RexxMsgPortPtr * = POINTER TO RexxMsgPort;
  313.   RexxMsgPort * = RECORD (RexxRsrcBase)
  314.     node *      : RexxRsrc;           (* linkage node                  *)
  315.     port *      : e.MsgPort;          (* the message port              *)
  316.     replyList * : e.List;             (* messages awaiting reply       *)
  317.   END; (* RexxMsgPort *)
  318.  
  319. CONST
  320.  
  321. (*
  322.  * DOS Device types
  323.  *)
  324.  
  325.   dtDev    * = 0;                   (* a device                      *)
  326.   dtDir    * = 1;                   (* an ASSIGNed directory *)
  327.   dtVol    * = 2;                   (* a volume                      *)
  328.  
  329. (*
  330.  * Private DOS packet types
  331.  *)
  332.  
  333.   actionStack * = 2002;             (* stack a line                  *)
  334.   actionQueue * = 2003;             (* queue a line                  *)
  335.  
  336.  
  337. (*
  338. **      $VER: errors.h 1.4 (8.11.91)
  339. **
  340. **      Definitions for ARexx error codes
  341. *)
  342.  
  343. CONST
  344.  
  345.   errcMsg  * = 0;                 (*  error code offset           *)
  346.   err10001 * = errcMsg+1;         (*  program not found           *)
  347.   err10002 * = errcMsg+2;         (*  execution halted            *)
  348.   err10003 * = errcMsg+3;         (*  no memory available         *)
  349.   err10004 * = errcMsg+4;         (*  invalid character in program*)
  350.   err10005 * = errcMsg+5;         (*  unmatched quote             *)
  351.   err10006 * = errcMsg+6;         (*  unterminated comment        *)
  352.   err10007 * = errcMsg+7;         (*  clause too long             *)
  353.   err10008 * = errcMsg+8;         (*  unrecognized token          *)
  354.   err10009 * = errcMsg+9;         (*  symbol or string too long   *)
  355.  
  356.   err10010 * = errcMsg+10;        (*  invalid message packet      *)
  357.   err10011 * = errcMsg+11;        (*  command string error        *)
  358.   err10012 * = errcMsg+12;        (*  error return from function  *)
  359.   err10013 * = errcMsg+13;        (*  host environment not found  *)
  360.   err10014 * = errcMsg+14;        (*  required library not found  *)
  361.   err10015 * = errcMsg+15;        (*  function not found          *)
  362.   err10016 * = errcMsg+16;        (*  no return value             *)
  363.   err10017 * = errcMsg+17;        (*  wrong number of arguments   *)
  364.   err10018 * = errcMsg+18;        (*  invalid argument to function*)
  365.   err10019 * = errcMsg+19;        (*  invalid PROCEDURE           *)
  366.  
  367.   err10020 * = errcMsg+20;        (*  unexpected THEN/ELSE        *)
  368.   err10021 * = errcMsg+21;        (*  unexpected WHEN/OTHERWISE   *)
  369.   err10022 * = errcMsg+22;        (*  unexpected LEAVE or ITERATE *)
  370.   err10023 * = errcMsg+23;        (*  invalid statement in SELECT *)
  371.   err10024 * = errcMsg+24;        (*  missing THEN clauses        *)
  372.   err10025 * = errcMsg+25;        (*  missing OTHERWISE           *)
  373.   err10026 * = errcMsg+26;        (*  missing or unexpected END   *)
  374.   err10027 * = errcMsg+27;        (*  symbol mismatch on END      *)
  375.   err10028 * = errcMsg+28;        (*  invalid DO syntax           *)
  376.   err10029 * = errcMsg+29;        (*  incomplete DO/IF/SELECT     *)
  377.  
  378.   err10030 * = errcMsg+30;        (*  label not found             *)
  379.   err10031 * = errcMsg+31;        (*  symbol expected             *)
  380.   err10032 * = errcMsg+32;        (*  string or symbol expected   *)
  381.   err10033 * = errcMsg+33;        (*  invalid sub-keyword         *)
  382.   err10034 * = errcMsg+34;        (*  required keyword missing    *)
  383.   err10035 * = errcMsg+35;        (*  extraneous characters       *)
  384.   err10036 * = errcMsg+36;        (*  sub-keyword conflict        *)
  385.   err10037 * = errcMsg+37;        (*  invalid template            *)
  386.   err10038 * = errcMsg+38;        (*  invalid TRACE request       *)
  387.   err10039 * = errcMsg+39;        (*  uninitialized variable      *)
  388.  
  389.   err10040 * = errcMsg+40;        (*  invalid variable name       *)
  390.   err10041 * = errcMsg+41;        (*  invalid expression          *)
  391.   err10042 * = errcMsg+42;        (*  unbalanced parentheses      *)
  392.   err10043 * = errcMsg+43;        (*  nesting level exceeded      *)
  393.   err10044 * = errcMsg+44;        (*  invalid expression result   *)
  394.   err10045 * = errcMsg+45;        (*  expression required         *)
  395.   err10046 * = errcMsg+46;        (*  boolean value not 0 or 1    *)
  396.   err10047 * = errcMsg+47;        (*  arithmetic conversion error *)
  397.   err10048 * = errcMsg+48;        (*  invalid operand             *)
  398.  
  399. (*
  400.  * Return Codes for general use
  401.  *)
  402.   ok     * = 0;                   (*  success                     *)
  403.   warn   * = 5;                   (*  warning only        *)
  404.   error  * = 10;                  (*  something's wrong           *)
  405.   fatal  * = 20;                  (*  complete or severe failure  *)
  406.  
  407.  
  408. (*
  409. **      $VER: rxslib.h 1.6 (8.11.91)
  410. **
  411. **      The header file for the REXX Systems Library
  412. *)
  413.  
  414.  
  415. CONST
  416.  
  417.   rxsName  * = "rexxsyslib.library";
  418.   rxsDir   * = "REXX";
  419.   rxsTName * = "ARexx";
  420.  
  421. (* The REXX systems library structure.  This should be considered as    *)
  422. (* semi-private and read-only, except for documented exceptions.        *)
  423.  
  424. TYPE
  425.  
  426.   RxsLibPtr * = POINTER TO RxsLib;
  427.   RxsLib * = RECORD (e.LibraryBase)
  428.     node *       : e.Library;        (* EXEC library node             *)
  429.     flags *      : s.SET8;           (* global flags                  *)
  430.     shadow *     : s.SET8;           (* shadow flags                  *)
  431.     sysBase *    : e.LibraryPtr;     (* EXEC library base             *)
  432.     dosBase *    : d.DosLibraryPtr;  (* DOS library base              *)
  433.     ieeeDPBase * : e.LibraryPtr;     (* IEEE DP math library base     *)
  434.     segList *    : e.BPTR;           (* library seglist               *)
  435.     nil *        : d.FileHandlePtr;  (* global NIL: filehandle        *)
  436.     chunk *      : LONGINT;          (* allocation quantum            *)
  437.     maxNest *    : LONGINT;          (* maximum expression nesting    *)
  438.     null *       : NexxStrPtr;       (* static string: NULL           *)
  439.     false *      : NexxStrPtr;       (* static string: FALSE          *)
  440.     true *       : NexxStrPtr;       (* static string: TRUE           *)
  441.     rexx *       : NexxStrPtr;       (* static string: REXX           *)
  442.     command *    : NexxStrPtr;       (* static string: COMMAND        *)
  443.     stdin *      : NexxStrPtr;       (* static string: STDIN          *)
  444.     stdout *     : NexxStrPtr;       (* static string: STDOUT         *)
  445.     stderr *     : NexxStrPtr;       (* static string: STDERR         *)
  446.     version *    : e.LSTRPTR;        (* version string                *)
  447.  
  448.     taskName *   : e.LSTRPTR;        (* name string for tasks *)
  449.     taskPri *    : LONGINT;          (* starting priority             *)
  450.     taskSeg *    : e.BPTR;           (* startup seglist               *)
  451.     stackSize *  : LONGINT;          (* stack size                    *)
  452.     rexxDir *    : e.LSTRPTR;        (* REXX directory                *)
  453.     cTABLE *     : e.LSTRPTR;        (* character attribute table     *)
  454.     notice *     : e.LSTRPTR;        (* copyright notice              *)
  455.  
  456.     rexxPort *   : e.MsgPort;        (* REXX public port              *)
  457.     readLock *   : e.UWORD;          (* lock count                    *)
  458.     traceFH *    : d.FileHandlePtr;  (* global trace console          *)
  459.     taskList *   : e.List;           (* REXX task list                *)
  460.     numTask *    : INTEGER;          (* task count                    *)
  461.     libList *    : e.List;           (* Library List header           *)
  462.     numLib *     : INTEGER;          (* library count                 *)
  463.     clipList *   : e.List;           (* ClipList header               *)
  464.     numClip *    : INTEGER;          (* clip node count               *)
  465.     msgList *    : e.List;           (* pending messages              *)
  466.     numMsg *     : INTEGER;          (* pending count                 *)
  467.     pgmList *    : e.List;           (* cached programs               *)
  468.     numPgm *     : INTEGER;          (* program count                 *)
  469.  
  470.     traceCnt *   : e.UWORD;          (* usage count for trace console *)
  471.     avail *      : INTEGER;
  472.   END; (* RxsLib *)
  473.  
  474. CONST
  475.  
  476. (* Global flag bit definitions for RexxMaster                           *)
  477.   (* trace * = trace;        (* interactive tracing?          *) *)
  478.   (* halt  * = halt;         (* halt execution?               *) *)
  479.   (* susp  * = susp;         (* suspend execution?            *) *)
  480.   stop  * = 6;               (* deny further invocations      *)
  481.   (* close * = 7;               (* close the master              *) *)
  482.  
  483.   rlfMask    * = { trace, halt, susp };
  484.  
  485. (* Initialization constants                                             *)
  486.   rxsChunk   * = 1024;        (* allocation quantum            *)
  487.   rxsNest    * = 32;          (* expression nesting limit      *)
  488.   rxsTPri    * = 0;           (* task priority         *)
  489.   rxsStack   * = 4096;        (* stack size                    *)
  490.  
  491. (* Character attribute flag bits used in REXX.                          *)
  492.   ctSpace   * = 0;                  (* white space characters        *)
  493.   ctDigit   * = 1;                  (* decimal digits 0-9            *)
  494.   ctAlpha   * = 2;                  (* alphabetic characters *)
  495.   ctRexxSym * = 3;                  (* REXX symbol characters        *)
  496.   ctRexxOpr * = 4;                  (* REXX operator characters      *)
  497.   ctRexxSpc * = 5;                  (* REXX special symbols          *)
  498.   ctUpper   * = 6;                  (* UPPERCASE alphabetic          *)
  499.   ctLower   * = 7;                  (* lowercase alphabetic          *)
  500.  
  501.  
  502. PROCEDURE [0] ActionCode * (action : LONGINT): LONGINT;
  503. (*
  504.  * Filter Command code out of RexxMsg.action. Result will be one of rxComm,
  505.  * rxFunc,...
  506.  *)
  507. BEGIN
  508.   RETURN SYS.VAL(LONGINT,SYS.VAL(SET,action) * SYS.VAL(SET,rxCodeMask));
  509. END ActionCode;
  510.  
  511.  
  512. PROCEDURE [0] ActionFlags * (action : LONGINT): s.SET32;
  513. (*
  514.  * Filter Command modifier flag bit out of RexxMsg.action. Result will be a set of
  515.  * rxfNoIO, rxfResult, ...
  516.  *)
  517. BEGIN
  518.   RETURN SYS.VAL(SET,action) * {16..23}
  519. END ActionFlags;
  520.  
  521. PROCEDURE [0] ActionArg * (action : LONGINT): LONGINT;
  522. (*
  523.  * Filter Arg out of RexxMsg.action.
  524.  *)
  525. BEGIN
  526.   RETURN action MOD 16;
  527. END ActionArg;
  528.  
  529. PROCEDURE [0] IVALUE * (nsPtr : NexxStrPtr): LONGINT;
  530. BEGIN
  531.   RETURN nsPtr.ivalue
  532. END IVALUE;
  533.  
  534. (* Field definitions                                                    *)
  535.  
  536. PROCEDURE [0] ARG0 * (rmp : RexxMsgPtr): e.APTR; (* start of argblock             *)
  537. BEGIN
  538.   RETURN rmp.args[0]
  539. END ARG0;
  540.  
  541. PROCEDURE [0] ARG1 * (rmp : RexxMsgPtr): e.APTR; (* first argument                *)
  542. BEGIN
  543.   RETURN rmp.args[1]
  544. END ARG1;
  545.  
  546. PROCEDURE [0] ARG2 * (rmp : RexxMsgPtr): e.APTR; (* second argument               *)
  547. BEGIN
  548.   RETURN rmp.args[2]
  549. END ARG2;
  550.  
  551.  
  552. (* The Library List contains just plain resource nodes.         *)
  553.  
  554. PROCEDURE [0] LLOFFSET * (rrp : RexxRsrcPtr): LONGINT;  (* "Query" offset     *)
  555. BEGIN
  556.   RETURN SYS.VAL(LONGINT,rrp.arg1)
  557. END LLOFFSET;
  558.  
  559. PROCEDURE [0] LLVERS * (rrp: RexxRsrcPtr): LONGINT;    (* library version    *)
  560. BEGIN
  561.   RETURN SYS.VAL(LONGINT,rrp.arg2)
  562. END LLVERS;
  563.  
  564. (*
  565.  * The RexxClipNode structure is used to maintain the Clip List.  The value
  566.  * string is stored as an argstring in the rr_Arg1 field.
  567.  *)
  568. PROCEDURE [0] CLVALUE * (rrp : RexxRsrcPtr): e.LSTRPTR;
  569. BEGIN
  570.   RETURN rrp.arg1
  571. END CLVALUE;
  572.  
  573.  
  574. END Rexx.
  575.